<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header('处理来电记录')"></head>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<style>

</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">

    <form class="form-horizontal" id="inputForm" th:object="${telGetDeal}">
        <input name="pkId" th:field="*{pkId}" type="hidden">
        <h4 class="form-header h4">来电人信息</h4>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>地区：</label>
                    <div class="col-sm-9">
                        <select name="fmAreaNo" id="fmAreaNo" onchange="dropChgSendTextOnly(this,'fmAreaName');"
                                th:with="district=${@commonServiceImpl.findArea()}" class="form-control formSelect"
                                th:field="*{fmAreaNo}">
                            <option value="">--请选择--</option>
                            <option th:each="item : ${district}" th:text="${item['CSText']}"
                                    th:value="${item['CSValue']}"></option>
                        </select>
                        <input type="hidden" id="fmAreaName" name="fmAreaName"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">地址：</label>
                    <div class="col-sm-9">
                        <input name="fmAddress" th:field="*{fmAddress}" autocomplete="off" placeholder="请输入地址"
                               class="form-control" type="text"
                               maxlength="100">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>性别：</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" value="1" th:field="*{fromSex}" name="fromSex">男
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" th:field="*{fromSex}" name="fromSex">女
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>来电人：</label>
                    <div class="col-sm-9">
                        <input name="fromName" autocomplete="off" th:field="*{fromName}" placeholder="请输入来电人"
                               class="form-control" type="text"
                               maxlength="11" required="" aria-required="true">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">电子邮件：</label>
                    <div class="col-sm-9">
                        <input name="fmEmail" th:field="*{fmEmail}" autocomplete="off" placeholder="请输入电子邮件"
                               class="form-control" type="text"
                               maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"></span>证件：</label>
                    <div class="col-sm-9">
                        <select id="fmCerNO" name="fmCerName"
                                th:with="cerTypes=${@commonServiceImpl.findCerType()}"
                                onchange="dropChgSendTextOnly(this,'fmCerName');"
                                class="form-control formSelect"
                                th:field="*{fmCerName}">
                            <option value="">--请选择--</option>
                            <option th:each="item : ${cerTypes}" th:text="${item['CSText']}"
                                    th:value="${item['CSText']}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">证件号码：</label>
                    <div class="col-sm-9">

                        <input name="fmCerNo" th:field="*{fmCerNo}" autocomplete="off" placeholder=""
                               class="form-control" type="text"
                               maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>来电号码(联系电话)：</label>
                    <div class="col-sm-9">
                        <input id="fromTelA" name="fromTelA" th:field="*{fromTelA}" autocomplete="off"
                               class="form-control"
                               style="width: 130px;display: inline-block;" type="text" maxlength="20" placeholder=""
                               required="" aria-required="true">
                        <input name="fromTelB" th:field="*{fromTelB}" autocomplete="off" class="form-control"
                               style="width: 130px;display: inline-block;" type="text" maxlength="20" placeholder="">
                        <input name="fromTelC" th:field="*{fromTelC}" autocomplete="off" class="form-control"
                               style="width: 130px;display: inline-block;" type="text" maxlength="20" placeholder="">
                    </div>
                </div>
            </div>
        </div>

        <h4 class="form-header h4">通话详情</h4>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">呼叫ID：</label>
                    <div class="col-sm-9">
                        <input name="callId" th:field="*{callId}" autocomplete="off" placeholder="" value="-1"
                               class="form-control"
                               type="text" maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">录音ID：</label>
                    <div class="col-sm-9">
                        <input name="tapeId" th:field="*{tapeId}" autocomplete="off" placeholder="" value="-1"
                               class="form-control"
                               type="text" maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>接听人：</label>
                    <div class="col-sm-9">
                        <input name="liftWorker" th:field="*{liftWorker}" autocomplete="off" placeholder=""
                               class="form-control" type="text"
                               maxlength="25" required="" aria-required="true">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>分机号：</label>
                    <div class="col-sm-9">
                        <input name="liftTelNo" th:field="*{liftTelNo}" autocomplete="off" placeholder=""
                               class="form-control" type="text"
                               maxlength="20" required="" aria-required="true">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>同意公开：</label>
                    <div class="col-sm-9" style="padding-right: 0;">
                        <label class="radio-inline">
                            <input type="radio" value="1" th:field="*{openFrom}" name="openFrom">是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" th:field="*{openFrom}" name="openFrom">否（来电人同意否？）
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">知识库：</label>
                    <div class="col-sm-9">
                        <input autocomplete="off" placeholder="" class="form-control" type="text" maxlength="50">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-sm-1"><span class="spRed">*</span>来电内容：</label>
                    <div class="col-sm-11">
                        <textarea class="form-control" th:field="*{fmContent}" rows="3" name="fmContent"
                                  id="fmContent"></textarea>
                        <!--<textarea name="fmContent" id="fmContent" style="width: 99%;min-width: 99%;max-width: 99%;height: 80px;padding: 8px;border: 1px solid #ddd;"></textarea>-->
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">流水号：</label>
                    <div class="col-sm-9">
                        <input name="wsCode" th:field="*{wsCode}" readonly="readonly" autocomplete="off"
                               placeholder="自动生成"
                               class="form-control" type="text" maxlength="20">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">查询码：</label>
                    <div class="col-sm-9">
                        <input name="wsKey" th:field="*{wsKey}" readonly="readonly" autocomplete="off"
                               placeholder="自动生成"
                               class="form-control" type="text" maxlength="20">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>接通时间：</label>
                    <div class="col-sm-9">

                        <input name="fromTime"
                               th:field="*{fromTime}"
                               autocomplete="off" placeholder="" class="form-control" type="text"
                               maxlength="50" required="" aria-required="true">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>挂断时间：</label>
                    <div class="col-sm-9">

                        <input name="liftEnd"
                               th:field="*{liftEnd}"
                               id="liftEnd" autocomplete="off" placeholder=""
                               class="form-control"
                               type="text" maxlength="20" required="" aria-required="true">
                    </div>
                </div>
            </div>
        </div>

        <h4 class="form-header h4">坐席处理情况</h4>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>来电类别：</label>
                    <div class="col-sm-9">

                        <select name="dFmClaNo" id="dFmClaNo"
                                th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                onchange="dropChgSendTextOnly(this,'dFmClaName');"
                                class="form-control formSelect" th:field="*{dfmClaNo}">
                            <option value="">--请选择--</option>
                            <th:block th:each="item : ${telTypes}">
                                <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                            </th:block>
                        </select>
                        <input type="hidden" name="dFmClaName" id="dFmClaName"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>内容类别：</label>
                    <div class="col-sm-9">
                        <!--                        th:field="*{dCntAName}"-->
                        <input id="treeName" name="dCntAName" onclick="selectDeptTree()"
                               class="form-control" th:field="*{dcntAname}"
                               type="text" maxlength="50" required="" aria-required="true">
                        <input id="treeId" name="dCntACode" type="hidden"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">模板名称：</label>
                    <div class="col-sm-9">
                        <!--                        th:field="*{sortModelNum}"-->
                        <input name="sortModelNum" autocomplete="off" placeholder=""
                               class="form-control" type="text"
                               maxlength="50">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>重复来电：</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" value="1" th:field="*{repeatFlag}" name="repeatFlag">是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" th:field="*{repeatFlag}" name="repeatFlag">否（来电内容是否重复）
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <button type="button" id="myModal" class="btn btn-default" onclick="openHistory()">历史记录</button>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>建议公开：</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" value="1" th:field="*{openX}" name="openX">是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" th:field="*{openX}" name="openX">否（公开办理过程）
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>坐席处理：</label>
                    <div class="col-sm-10">
                        <select id="xDealDescSelect" class="form-control formSelect" style="margin-bottom: 5px;"
                                onchange="dropChgSendTextOnly(this,'xdealDesc');">
                            <option value="-1">---处理来电常用语---</option>
                            <option value="-110">请 XXX 调查处理后直接与来话人联系，并将处理结果抄复我办。</option>
                            <option value="-120">已当场处理</option>
                            <option value="-130">来话人反映外地（xx市）问题，建议其向当地职能部门反映</option>
                            <option value="-140">请来话人了解清楚后再做反映</option>
                            <option value="-150">已建议来话人以适当形式向市纪委监察局（12388）反映</option>
                            <option value="-160">查询知识库或相关资料，告知来话人：</option>
                            <option value="-170">建议来话人：</option>
                            <option value="-180">经查，反映问题与（工单编号：）相同，告知来话人已有市民反映，且职能部门正在办理</option>
                            <option value="-190">
                                经查，工单编号为（）的来电，相关部门正在积极的处理中，请耐心等待处理结果。12345热线公开电话的处理时限为：一般问题5个工作日内回复，较复杂问题15个工作日内给予回复，特别重大及疑难问题按照信访条列60天内回复。欢迎多提宝贵意见！
                            </option>
                            <option value="-200">记录并整理通话内容，告知来话人后续由相关职能部门进行办理</option>
                            <option value="-210">感谢您对成都市政府工作的关心和支持。欢迎多提宝贵意见！</option>
                            <option value="-220">已当即联系自来水公司（962965）、电业局（95598）、天然气公司（962777）的***号工作人员处理。</option>
                            <option value="-230">您所反映的问题我办已多次受理，并且相关部门已进行多次回复和解释，对此我办不再受理该问题，请您通过其他途径解决</option>
                            <option value="-240">据查，您反映情况不属实，并且相关部门已进行了回复和解释，对此我办不再受理该问题。</option>
                        </select>
                        <textarea name="xdealDesc" id="xdealDesc" th:field="*{xdealDesc}" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">坐席备注：</label>
                    <div class="col-sm-10">
                        <select id="xSysDescSelect" class="form-control formSelect" style="margin-bottom: 5px;"
                                onchange="dropChgSendTextOnly(this,'xsysDesc');">
                            <option value="-1">---内部交流常用语---</option>
                            <option value="110">无效来电，请核查办结</option>
                            <option value="120">当场办结，请核查办结</option>
                            <option value="130">建议回电联系来话人后酌情处理</option>
                            <option value="140">反映问题与（）相同，酌情催办工单</option>
                            <option value="150">建议创建工单，请职能部门（）办理。</option>
                            <option value="150">来话人特别要求：</option>
                        </select>
                        <textarea name="xsysDesc" th:field="*{xsysDesc}" id="xsysDesc" rows="3"
                                  class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </div>

        <h4 class="form-header h4">值班长处理情况</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>提交选项：</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" value="121" th:field="*{stateFlag}" name="stateFlag"
                                   onclick="stDescSet('退回坐席')">退回坐席
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="122" th:field="*{stateFlag}" name="stateFlag"
                                   onclick="stDescSet('暂存')">暂存
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="136" th:field="*{stateFlag}" name="stateFlag"
                                   onclick="stDescSet('回电解答')">回电解答
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="135" th:field="*{stateFlag}" name="stateFlag"
                                   onclick="stDescSet('无效')">无效
                        </label>
                        <input id="tbStateDesc" th:field="*{stateDesc}" name="stateDesc" type="hidden"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>坐席处理(归档可见)：</label>
                    <div class="col-sm-10">
                        <textarea name="ydealDesc"th:field="*{ydealDesc}" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">坐席备注(坐席可见)：</label>
                    <div class="col-sm-10">
                        <textarea name="ysysDesc" th:field="*{ysysDesc}" rows="3"
                                  class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>处理人：</label>
                    <div class="col-sm-10">
                        <input id="yworkNo" name="yworkNo"  th:field="*{yworkNo}" type="hidden"/>
                        <input name="yworker" th:field="*{yworker}" id="yworker" autocomplete="off" placeholder=""
                               class="form-control"
                               type="text" maxlength="20" required aria-required="true">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">处理时间(坐席可见)：</label>
                    <div class="col-sm-10">
                        <input name="yeditTime"
                               th:field="*{yeditTime}"
                               id="yeditTime" autocomplete="off" placeholder=""
                               class="form-control"
                               type="text" maxlength="20" aria-required="true">

                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">工单概况</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>是否创建：</label>
                    <div class="col-sm-10">
<!--                        <input id="wkFmFlag" autocomplete="off" placeholder=""-->
<!--                               class="form-control" type="text"-->
<!--                               maxlength="50" name="wkFmFlag"-->
<!--                               style="border: none"-->
<!--                               th:field="*{wkFmFlag}" >-->
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">工单编号：</label>
                    <div class="col-sm-10">
                        <!--                        <textarea name="wkFmNo" th:field="*{wkFmNo}" rows="3"-->
                        <!--                                  class="form-control"></textarea>-->
<!--                        <input type="" name="wkFmNo" th:field="*{wkFmNo}">-->
<!--                        <input id="wkFmNo" autocomplete="off" placeholder=""-->
<!--                               class="form-control" type="text"-->
<!--                               maxlength="50" name="wkFmNo"-->
<!--                               style="border: none"-->
<!--                               th:field="*{wkFmNo}">-->
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button id="lock" type="button" title="解锁后由本账户处理" class="btn btn-sm btn-primary" onclick="unlock()"><i
                class="fa fa-check"></i>解除锁定
        </button>&nbsp;
        <button id="sbt" class="btn btn-info" style="display: none" onclick="submitHandler();">提交</button>
        <button id="workFrom" class="btn btn-default" style="display: none" onClick="workFormCreate();">创建工单
        </button>
        <button id="close" type="button" style="display: none" class="btn btn-sm btn-danger" onclick="closeItem()">
            <i
                    class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script type="text/javascript">
    var prefix = ctx + "system/mTelRcd";
    $("#inputForm").validate({
        rules: {
            xxxx: {
                required: true,
            },
        }
    });

    function submitHandler() {
        var stateFlag = $("input[name=stateFlag]");
        let i = 0;
        for (;i < stateFlag.length; i++) {
            if (stateFlag[i].checked) {
                break;
            }
        }
        if (i>=stateFlag.length) {
            alert("请选择处理选项")
            return;
        }

        if ($.validate.form()) {
            var data = $('#inputForm').serializeArray();
            $.operate.saveTab(prefix + "/edit", data);
        }
    }

    /*部门管理-新增-选择父部门树*/
    function selectDeptTree() {
        var options = {
            title: '内容类别选择',
            width: "380",
            url: ctx + "system/common/findContentCategories/11",
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero) {
        var body = layer.getChildFrame('body', index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        layer.close(index);
    }

    $(function () {
        $('#liftEnd').click(function () {
            $(this).val(new Date().format('yyyy-MM-dd hh:mm:ss'));
        });
    });

    function stDescSet(fpStr) {
        $("#tbStateDesc").val(fpStr);
    }

    function unlock() {
        $("#lock").hide();
        $("#sbt").show();
        $("#workFrom").show();
        $("#close").show();
    }

    function openHistory() {
        url = prefix + "/telOver/" + $("#fromTelA").val();
        $.modal.open("历史记录", url);
    }


    $(document).ready(function () {
        $("#yeditTime").val(DateToStr());
    })
</script>
</body>
</html>